home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / audio / drive / Simulation.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.3 KB  |  80 lines

  1. /*
  2.  * Copyright 1992-1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. //////////////////////////////////////////////////////////////////////
  18. // Simulation.h - definition of the simulation class
  19. //////////////////////////////////////////////////////////////////////
  20.  
  21. #ifndef SIMULATION_H
  22. #define SIMULATION_H
  23.  
  24. #include <Inventor/SbPList.h>
  25. #include <Inventor/SbString.h>
  26. #include "Defines.h"
  27. #include "Car.h"
  28. #include "Driver.h"
  29.  
  30. class Car;
  31. class Road;
  32. class SbPList;
  33. class Network;
  34.  
  35. class Simulation  {
  36.  
  37. public:
  38.  
  39.     Simulation(
  40.         SbString roadfile, SbString carfile, SbString path,
  41.         int num_robots,    Boolean quiet, Boolean race);
  42.     ~Simulation();
  43.     
  44.     void go();
  45.  
  46.     const SbPList * get_car_list() const { return _car_list; };
  47.  
  48.     float get_fps() const { return _fps; };
  49.  
  50.     // returns TRUE if the simulation should be making noise
  51.     Boolean play_sound() const { return _play_sound; };
  52.  
  53.     // returns TRUE if the hardware is capable of sound
  54.     Boolean sound_capable() const { return _sound_capable; };
  55.  
  56.     // toggles the sound and returns the result.
  57.     Boolean toggle_sound()
  58.     {_play_sound = _sound_capable && (!_play_sound); return _play_sound; };
  59.  
  60.     SbString get_path() const { return _path; };
  61.     
  62. protected:
  63.  
  64.     SbPList * _car_list; // list of cars, first is the local car
  65.  
  66.     Road * _road; // the roadway used by the current simulation
  67.     
  68.     Network * _network; // network communication for racing
  69.  
  70.     float _fps; // frames per second for the local driver
  71.  
  72.     Boolean _sound_capable; // TRUE if this machine can support sound
  73.     Boolean _play_sound; // TRUE if simulation should make noise
  74.  
  75.     SbString _path; // path to the data files, including a trailing "/"
  76. };
  77.  
  78. #endif
  79.     
  80.